Skip to content

Conversation

jbaiera
Copy link
Member

@jbaiera jbaiera commented Aug 21, 2025

If a data stream indices list is ever empty, then it cannot accept any write traffic. This is a state that is not allowed in the normal backing indices, but as we add more index sets to a data stream that are lazily created like failure store, this property should not only reflect any state that was marked via a lazy rollover API call, but also be forced on when no indices exist so that they may be initialized on first write.

An upgrade test is present to ensure that failure store indices created on versions from before their support are able to be enabled and used.

Fixes #133176

@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Aug 21, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@elasticsearchmachine
Copy link
Collaborator

Hi @jbaiera, I've created a changelog YAML for you.

@jbaiera
Copy link
Member Author

jbaiera commented Aug 21, 2025

CI is failing because rollover on write is forced true on any data stream index set which is empty, but this is not allowed because data streams created for CCR may not have rollover on write enabled. As such, I have a fix coming in which should simply update the default places in deserialization that we set the flag and make them default to true on an empty index list.

Edit: Applied in d07c763 and e2025f6

Copy link
Member

@masseyke masseyke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@samxbr samxbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

dataStreamOptions,
new DataStreamIndices(BACKING_INDEX_PREFIX, List.copyOf(indices), rolloverOnWrite, autoShardingEvent),
new DataStreamIndices(FAILURE_STORE_PREFIX, List.copyOf(failureIndices), false, null)
new DataStreamIndices(FAILURE_STORE_PREFIX, List.copyOf(failureIndices), failureIndices.isEmpty(), null)
Copy link
Contributor

@samxbr samxbr Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the reason we force rolloverOnWrite as a param to the next constructor here instead other constructor to bypass the CCR error you mentioned? If so I find it a little subtle to read, but I am not sure how to do it more explicitly.
Disregard this, I think I mis-read the constructor arguments, there are too many of them

@jbaiera jbaiera force-pushed the fix-failure-store-upgrade branch from 390818d to d7fbb12 Compare August 22, 2025 05:34
@jbaiera jbaiera merged commit 5ae52bf into elastic:main Aug 22, 2025
33 checks passed
@jbaiera
Copy link
Member Author

jbaiera commented Aug 22, 2025

💚 All backports created successfully

Status Branch Result
9.1
8.19

Questions ?

Please refer to the Backport tool documentation

jbaiera added a commit to jbaiera/elasticsearch that referenced this pull request Aug 22, 2025
elastic#133347)

Updates the serialization and construction logic for failure store components to bias rollover
on write to true when no indices are present in the failure store index set.

---------

Co-authored-by: elasticsearchmachine <[email protected]>
Co-authored-by: Keith Massey <[email protected]>
(cherry picked from commit 5ae52bf)
pabloem pushed a commit to pabloem/elasticsearch that referenced this pull request Aug 22, 2025
elastic#133347)

Updates the serialization and construction logic for failure store components to bias rollover 
on write to true when no indices are present in the failure store index set.

---------

Co-authored-by: elasticsearchmachine <[email protected]>
Co-authored-by: Keith Massey <[email protected]>
elasticsearchmachine pushed a commit that referenced this pull request Aug 22, 2025
#133347) (#133406)

Updates the serialization and construction logic for failure store components to bias rollover
on write to true when no indices are present in the failure store index set.

---------



(cherry picked from commit 5ae52bf)

Co-authored-by: elasticsearchmachine <[email protected]>
Co-authored-by: Keith Massey <[email protected]>
jbaiera added a commit that referenced this pull request Aug 22, 2025
…is empty (#133347) (#133407)

Updates the serialization and construction logic for failure store components to bias rollover
on write to true when no indices are present in the failure store index set.
@jbaiera jbaiera deleted the fix-failure-store-upgrade branch August 22, 2025 19:43
phananh1010 added a commit to phananh1010/elasticsearch that referenced this pull request Aug 28, 2025
phananh1010 added a commit to phananh1010/elasticsearch that referenced this pull request Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Data Management/Data streams Data streams and their lifecycles Team:Data Management Meta label for data/management team v8.19.3 v9.1.3 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failure store fails to initialize on data streams from prior cluster versions

4 participants